//题目链接：https://www.luogu.com.cn/problem/P2142
#include <iostream>
#include <vector>
using namespace std;

vector<int> sub(vector<int>& A,vector<int>& B)
{
    vector<int> C;
    for(int i = 0 , t = 0 ; i < A.size() ; ++i)
    {
        t = A[i] - t;
        if(i < B.size()) t -= B[i];
        C.push_back( (t+10) % 10);
        if(t < 0) t = 1;
        else t = 0;
    }
    while(C.size() > 1 && C.back() == 0) C.pop_back();
    return C;
}

int main()
{
    string s1,s2;
    cin >> s1 >> s2;
    vector<int> A,B;
    for(int i = s1.size() - 1 ; i >= 0 ; --i) A.push_back(s1[i]-'0');
    for(int i = s2.size() - 1 ; i >= 0 ; --i) B.push_back(s2[i]-'0');
    vector<int> C;
    if(s1.size() < s2.size() || (s1.size() == s2.size() && s1 < s2))
    {
        printf("-");
        C = sub(B,A);
    }
    else C = sub(A,B);
    for(int i = C.size()-1 ; i >= 0 ; --i) printf("%d",C[i]);
    return 0;
}